﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using UtilityLibrary.WinControls;
using WeifenLuo.WinFormsUI.Docking;

namespace STKMIS
{
    public partial class FrmLeftMenu : FrmBase
    {
        public FrmLeftMenu()
        {
            InitializeComponent();
            this.AutoHidePortion = 180;
            outLookBandSales.LargeImageList = this.imgList;
            outLookBandSales.Items.Add(new OutlookBarItem("销售开单", 7));
            outLookBandSales.Items.Add(new OutlookBarItem("销售单管理", 16));
            outLookBandSales.Items.Add(new OutlookBarItem("销售统计", 15));
            outLookBandSales.Background = SystemColors.AppWorkspace;

            outlookBandPurchase.LargeImageList = this.imgList;
            outlookBandPurchase.Items.Add(new OutlookBarItem("采购入库", 12));
            //outlookBandPurchase.Items.Add(new OutlookBarItem("采购单管理", 16));
            //outlookBandPurchase.Items.Add(new OutlookBarItem("采购统计", 15));
            outlookBandPurchase.Background = SystemColors.AppWorkspace;

            outLookBandSearch.LargeImageList = this.imgList;
            outLookBandSearch.Items.Add(new OutlookBarItem("采购入库", 13));
            outLookBandSearch.Items.Add(new OutlookBarItem("销售出库", 3));
            outLookBandSearch.Items.Add(new OutlookBarItem("库存查询", 20));
            outLookBandSearch.Items.Add(new OutlookBarItem("库存统计", 10));
            outLookBandSearch.Background = SystemColors.AppWorkspace;

            outLookBandBaseInfo.LargeImageList = this.imgList;
            outLookBandBaseInfo.Items.Add(new OutlookBarItem("客户信息", 4));
            outLookBandBaseInfo.Items.Add(new OutlookBarItem("供货商信息", 18));
            outLookBandBaseInfo.Items.Add(new OutlookBarItem("产品信息", 17));
            outLookBandBaseInfo.Items.Add(new OutlookBarItem("仓库信息", 1));
            outLookBandBaseInfo.Items.Add(new OutlookBarItem("数据字典", 21));
            outLookBandBaseInfo.Background = SystemColors.AppWorkspace;

            outLookBandSysManage.LargeImageList = this.imgList;
            outLookBandSysManage.Items.Add(new OutlookBarItem("用户管理", 22));
            outLookBandSysManage.Items.Add(new OutlookBarItem("角色管理", 8));
            outLookBandSysManage.Items.Add(new OutlookBarItem("权限管理", 6));
            outLookBandSysManage.Background = SystemColors.AppWorkspace;

            outLookLeftMenu.SetCurrentBand(0);
        }

        private void outLookLeftMenu_ItemClicked(OutlookBarBand band, OutlookBarItem item)
        {
            switch (item.Text)
            {
                case "采购入库":
                    {
                        if (FrmMain.frmPurchaseInStorage == null)
                        {
                            FrmMain.frmPurchaseInStorage = new FrmPurchaseInStorage();
                            FrmMain.frmPurchaseInStorage.Show(FrmMain.frmMain.dockPanelMain, DockState.Document);
                        }
                        else
                        {
                            if (FrmMain.frmPurchaseInStorage.IsDisposed)
                            {
                                FrmMain.frmPurchaseInStorage = new FrmPurchaseInStorage();
                                FrmMain.frmPurchaseInStorage.Show(FrmMain.frmMain.dockPanelMain, DockState.Document);
                            }
                            else
                            {
                                FrmMain.frmPurchaseInStorage.Show(FrmMain.frmMain.dockPanelMain, DockState.Document);
                            }
                        }

                        break;
                    }
                case "销售开单":
                    {
                        if (FrmMain.frmSalesbilling == null)
                        {
                            FrmMain.frmSalesbilling = new FrmSalesbilling();
                            FrmMain.frmSalesbilling.Show(FrmMain.frmMain.dockPanelMain, DockState.Document);
                        }
                        else
                        {
                            if (FrmMain.frmSalesbilling.IsDisposed)
                            {
                                FrmMain.frmSalesbilling = new FrmSalesbilling();
                                FrmMain.frmSalesbilling.Show(FrmMain.frmMain.dockPanelMain, DockState.Document);
                            }
                            else
                            {
                                FrmMain.frmSalesbilling.Show(FrmMain.frmMain.dockPanelMain, DockState.Document);
                            }
                        }

                        break;
                    } 

                default:
                    break;
            }
        }
    }
}
